﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Đăng ảnh
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server">
<%
    int lang  = 2;
%>

    <div>

        <div id="direction" style="width:400px; float:left; padding-top:15px;">
            <div class="right-arrow"></div>
            <div style="font-size:14px; float:left;"><%= Html.ActionLink("ĐĂNG ẢNH","Upload","Image") %></div>
        </div>
        <div id="searchTool" style="width:600px; float:right;">
            <table border="0" cellspacing="5" cellpadding="5" style="float:right;">
                <tr>
                    <td>
                        <%-- Textbox --%>
                        <table cellpadding="0" cellspacing="0" border="0">
	                        <tr class="tr-textbox">    
    	                        <td class="left-textbox"></td>
                                <td class="center-textbox"><input value="Từ khóa ..." size="40" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtSearch" type="text" class="search-textbox"/></td>
    	                        <td class="right-textbox"></td>    
                            </tr>
                        </table>
                    </td>
                    <td>
                        <%-- Button --%>
                        <div style="cursor:pointer;" onmouseout="buttonmouseout('Search');" onmousedown="buttonmousedown('Search');" onmouseover="buttonmouseover('Search');"><table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td id="lbtnSearch" class="left-button"></td>
                                <td id="mbtnSearch" class="middle-button"><span style="color:White;">TÌM KIẾM</span></td>
                                <td id="rbtnSearch" class="right-button"></td>                        
                            </tr>          
                        </table></div>                    
                    </td>
                    <td class="horizontalborder-twoline"></td>
                    <td style="font-size:14px"><div style="cursor:pointer"><i><%=Html.ActionLink("Tìm kiếm nâng cao", "Index", "Search") %></i></div></td>
                </tr>
            </table>
        
        </div>
    </div>

    <div style="margin:10px 10px 5px 10x; clear:both;">
        
        <div style="float:left; padding-top:20px; margin-left:5px; margin-right:5px; width:250px;">Chọn chủ đề</div>
        <div style="float:left; padding-top:20px; margin-left:5px; margin-right:5px; width:250px;">Chọn chủ đề con cần đăng</div>
        <div style="float:left; padding-top:20px; margin-left:5px; margin-right:5px; width:480px;">Nhập thông tin ảnh</div>
                
    </div>

    <div style="margin:5px 10px 5px 10x; clear:both;">
        
        <div id="CatList" class="dotpanel" style="margin:10px 5px 5px 5px; width:250px; height:600px; float:left;">
             <div class="scrollbar1" style="width:230px; margin:10px 10px 10px 10px;">
		            <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
		                <div class="viewport" style="width:220px; height:580px;">
			                <div class="overview">
<%
    List<VietImage.Models.Category> lst = new List<VietImage.Models.Category>();
    if (ViewData["CategoryList"] != null)
    {
        lst = (List<VietImage.Models.Category>)ViewData["CategoryList"];
    }
    VietImage.Models.Category selectedCat = null;
    if (ViewData["SelectedCategory"] != null)
    {
        selectedCat = (VietImage.Models.Category)ViewData["SelectedCategory"];
    }
    String s = "";
    String selected = "";
    foreach (VietImage.Models.Category cat in lst)
    {
        selected = "";
        if (ViewData["SelectedCategory"] != null)
        {
            if (selectedCat.ID == cat.ID || (!selectedCat.IsParent && selectedCat.Parents[0].ID == cat.ID))
            {
                selected = "class=\"selectedcat\"";
            }
        }
        s = "<p " + selected + " id=\"Cat" + cat.ID + "\">" + cat.GetDetail(lang).Name + "</p>";
        %>
                            <%= s %>
        <%
    }
%>

                            </div>
                        </div>
            </div>
        </div>
        <div style="margin:10px 5px 5px 5px; width:250px; height:600px; float:left;">
            <div id="SubCatList" class="dotpanel" style="width:250px; height:400px; float:left;">  
                 <div class="scrollbar1" style="width:230px; margin:10px 10px 10px 10px;">
		                <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
		                    <div class="viewport" style="width:220px; height:380px;">
			                    <div class="overview">
<% 
    s = "";
    selected = "";
    lst = null;
    if (selectedCat == null)
    {
        lst = new List<VietImage.Models.Category>();
    }
    else if (selectedCat.IsParent)
    {
        lst = selectedCat.Children;
    }
    else{
        lst = selectedCat.Parents[0].Children;
    }
    foreach (VietImage.Models.Category cat in lst)
    {
        selected = "";
        if (selectedCat.ID == cat.ID)
        {
            selected = "class=\"selectedcat\"";
        }
        s = "<p " + selected + " id=\"SubCat" + cat.ID + "\">" + cat.GetDetail(lang).Name + "</p>";
        %>
                            <%= s%>
        <%
    }
%>                                    

                                </div>
                            </div>
                </div>      
            </div>
            <div style="padding-top:5px; padding-bottom:5px; clear:both;">Hoặc tạo chùm ảnh mới</div>
            <div class="dotpanel" style=" margin-top:10px; width:250px; height:163px; float:left;">    
                <div style="padding:10px 10px 10px 10px;">
                    <p>Tên chùm ảnh</p>
                    <div style="padding-bottom:20px; padding-left:10px;">
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr class="tr-textbox">    
                                <td class="left-textbox"></td>
                                <td class="center-textbox"><input size="30" name="txtCategory" type="text" class="textbox"/></td>
                                <td class="right-textbox"></td>    
                            </tr>
                        </table>
                    </div>
                    <div style="padding-bottom:10px; padding-left:10px; float:right; margin-right:15px;">
                        <div style="cursor:pointer;" onmouseout="buttonmouseout('Create');" onmousedown="buttonmousedown('Create');" onmouseover="buttonmouseover('Create');"><table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td id="lbtnCreate" class="left-button"></td>
                                <td id="mbtnCreate" class="middle-button"><span style="color:White;">TẠO</span></td>
                                <td id="rbtnCreate" class="right-button"></td>                        
                            </tr>          
                        </table></div>
                    </div>               
                </div>
            </div>
        </div>
        <div class="dotpanel" style="margin:10px 5px 5px 5px; width:480px; height:400px; float:left;">
            <div style="margin:10px 10px 10px 10px;">
                <div style="padding:0px 10px 10px 10px;">
                    <p style="margin-bottom:-5px;">Chọn ảnh cần đăng</p>
                    <div style="padding-left:10px; float:left;">
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr class="tr-textbox">    
                                <td class="left-textbox"></td>
                                <td class="center-textbox"><input size="50" id="txtImgFiles" name="txtImgFiles" type="text" class="textbox"/><input style="display: none;" type="file" id="file1" name="file1" class="filebrowse" value="">
                                </td>
                                <td class="right-textbox"></td>    
                            </tr>
                        </table>
                    </div>
                    <div class="browsefilebutton" style="float:left; margin-left:10px;">
                        <div style="cursor:pointer;" onmouseout="buttonmouseout('Select');" onmousedown="buttonmousedown('Select');" onmouseover="buttonmouseover('Select');"><table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td id="lbtnSelect" class="left-button"></td>
                                <td id="mbtnSelect" class="middle-button"><span style="color:White;">CHỌN</span></td>
                                <td id="rbtnSelect" class="right-button"></td>                        
                            </tr>          
                        </table></div>
                    </div>
                    <div style="padding-top:10px; clear:both;">
                        <p>Thông tin chung</p>
                        <div style="margin-top:-20px;">
                            <table cellpadding="3" cellspacing="3" border="0" style="width:100%; padding-left:10px;">
                                <tr>
                                    <td style="width:100px; text-align:left;">Ngày chụp</td>
                                    <td style="text-align:left;">
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr class="tr-textbox">    
                                                <td class="left-textbox"></td>
                                                <td class="center-textbox"><input size="45" name="txtTakenTime" type="text" class="textbox"/></td>
                                                <td class="right-textbox"></td>    
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:100px; text-align:left;">Địa điểm chụp</td>
                                    <td style="text-align:left;">
                                    Thành phố Quốc gia
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:100px; text-align:left;">Tác giả</td>
                                    <td style="text-align:left;">
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr class="tr-textbox">    
                                                <td class="left-textbox"></td>
                                                <td class="center-textbox"><input size="45" name="txtAuthor" type="text" class="textbox"/></td>
                                                <td class="right-textbox"></td>    
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:100px; text-align:left;">Từ khóa</td>
                                    <td style="text-align:left;">
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr class="tr-textbox">    
                                                <td class="left-textbox"></td>
                                                <td class="center-textbox"><input size="45" name="txtTag" type="text" class="textbox"/></td>
                                                <td class="right-textbox"></td>    
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:100px; text-align:left; vertical-align:top;">Nội dung</td>
                                    <td style="text-align:left;">
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr class="tr-textbox">    
                                                <td class="left-textbox"></td>
                                                <td class="center-textbox"><input size="45" name="txtTag" type="text" class="textbox"/></td>
                                                <td class="right-textbox"></td>    
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div style="cursor:pointer; float:right; margin-right:10px;" onmouseout="buttonmouseout('Upload');" onmousedown="buttonmousedown('Upload');" onmouseover="buttonmouseover('Upload');"><table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td id="lbtnUpload" class="left-button"></td>
                                                <td id="mbtnUpload" class="middle-button"><span style="color:White;">ĐĂNG</span></td>
                                                <td id="rbtnUpload" class="right-button"></td>                        
                                            </tr>          
                                        </table></div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>               
                </div>
            </div>
        </div>
                
    </div>
    <script>
        loaddotpanel();
    </script>
    </form>
</asp:Content>
